package com.dljd.javase.t11;

import java.io.FileInputStream;
import java.io.FileOutputStream;

public class FileCopyDemo {

    public static void main(String[] args)  throws Exception{
        FileInputStream fIn=new FileInputStream("D:/test.txt");
        FileOutputStream fOut=new FileOutputStream("E:/test.txt");

        byte[] bs=new byte[1024*1024];
        int len=-1;
        long startTime=System.currentTimeMillis();
        while((len= fIn.read(bs))!=-1){
            fOut.write(bs,0,len);
            //System.out.println(byteValue);
        }
        long endTime=System.currentTimeMillis();

        System.out.println("haoshi:"+(endTime-startTime)+"ms");
        fOut.close();
        fIn.close();

    }
}
